AllowNestingPropertyDrawer.cs 454 B

12345678910111213141516
  1. using UnityEngine;
  2. using UnityEditor;
  3. namespace ExternPropertyAttributes.Editor
  4. {
  5. [CustomPropertyDrawer(typeof(AllowNestingAttribute))]
  6. public class AllowNestingPropertyDrawer : PropertyDrawerBase
  7. {
  8. protected override void OnGUI_Internal(Rect rect, SerializedProperty property, GUIContent label)
  9. {
  10. EditorGUI.BeginProperty(rect, label, property);
  11. EditorGUI.PropertyField(rect, property, label, true);
  12. EditorGUI.EndProperty();
  13. }
  14. }
  15. }